using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace SampleTemplate
{
	public class SampleTemplateGame : Game
	{
		private GraphicsDeviceManager _graphics;
		private SpriteBatch _spriteBatch;

		public SampleTemplateGame ()
		{
			_graphics = new GraphicsDeviceManager (this);
			Content.RootDirectory = "Content";
			IsMouseVisible = true;

			_graphics.PreferredBackBufferHeight = 600;
			_graphics.ApplyChanges();
		}

		protected override void Initialize ()
		{
			// TODO: Add your initialization logic here

			base.Initialize ();
		}

		private SpriteFont _spriteFont;

		protected override void LoadContent ()
		{
			_spriteBatch = new SpriteBatch (GraphicsDevice);
			_spriteFont = Content.Load<SpriteFont> ("Fonts/Arial");
			// TODO: use this.Content to load your game content here
		}

		protected override void Update (GameTime gameTime)
		{
			if (GamePad.GetState (PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState ().IsKeyDown (Keys.Escape))
				Exit ();

			// TODO: Add your update logic here

			base.Update (gameTime);
		}

		protected override void Draw (GameTime gameTime)
		{
			GraphicsDevice.Clear (Color.CornflowerBlue);

			// TODO: Add your drawing code here
			_spriteBatch.Begin ();
			_spriteBatch.DrawString (_spriteFont, "test", Vector2.Zero, Color.White);
			_spriteBatch.End ();
			base.Draw (gameTime);
		}
	}
}